﻿using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using NewsReader.Helpers;
using NewsReader.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UnitTests
{
    [TestClass]
    public class DBTests
    {
        [TestMethod]
        public void ShouldDeleteAll()
        {
            PersistenceHelper.SaveFeedsToDB(new List<object>() 
            { 
                new FeedInfo("Test", "http://www.test.com"),
                new FeedInfo("Test2", "http://www.test.com2")
            });
        }

        [TestMethod]
        public void ShouldCreateNewDB()
        {
            var db = PersistenceHelper.GetUserDB();
            int currentVersion = PersistenceHelper.GetUserDBVersion();
            Assert.AreEqual(3, currentVersion, "Version is not currently 3");
        }
    }
}
